Repository navigation
IGNITE-29145 Label and comment on PRs with wire format changes - #13876
Conversation
|
The wire format check runs with the other PR checks. It runs when you open or reopen a PR and when you push new commits to its branch. That's why I removed the separate
I tested both cases in my fork. In PR #22, a rerun replaced the old warning with one new comment. In PR #23, I removed the wire change. The bot removed its warning and the label. The reviewer comment stayed. |
71a5a55 to
157fcf5
Compare
| const comments = await list(issues.listComments, issue); | ||
| const {data: pr} = await pulls.get({...repo, pull_number: target.number}); | ||
| if (pr.state !== 'open' || pr.head.repo?.id !== run.head_repository.id || pr.head.ref !== run.head_branch | ||
| || pr.head.sha !== run.head_sha || pr.base.ref !== target.base.ref) |
There was a problem hiding this comment.
An older run can overwrite a newer result even when this check passes. Suppose the first run finds a wire diff. While the PR is closed, the same wire change lands independently on master. Reopening the PR triggers a new comparison, which finds no diff and clears the warning. Rerunning the original publisher then restores the stale warning and label because the PR head SHA and target branch name still match. Could we skip publication when a newer verified comparison has already reported for the same PR head and target branch?
There was a problem hiding this comment.
I added a check for this in an earlier commit, but later removed it. It made the workflow harder to maintain, and this case is rare.
If an old run posts the wrong result, we can run the publisher again for the newer build. That will fix the label and the comment. I’d prefer to keep the workflow simple.
| for (const comment of comments) { | ||
| if (comment.user?.login === 'github-actions[bot]' && comment.body?.startsWith(marker)) | ||
| await issues.deleteComment({...repo, comment_id: comment.id}); |
There was a problem hiding this comment.
If the diff is still present and GitHub returns a 503 when creating the replacement comment, this deletion has already removed the only link to the report. Could we post the new warning first, then delete the old warnings from the list fetched above? That way a failed post preserves the previous link, and a later successful run can clean up any duplicates.
e0e096f to
ab944ad
Compare
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see tabPR Checkat TC.Bot - Instance 1 or TC.Bot - Instance 2)Notes
If you need any help, please email dev@ignite.apache.org or ask any advice on https://the-asf.slack.com #ignite channel.